package week07.data_obs2;



import java.util.Observable;
import java.util.Observer;

/**
 * Created by zhangxiaokun on 2018/3/13.
 */
public class OddObserver implements Observer {
    @Override
    public void update(Observable o, Object arg) {
        if (arg == NumsObservable.ODD) {
            NumsObservable num = (NumsObservable) o;
            int data = num.getData();
            System.out.println("----OddObserver:Data has changed to " + data);
        }
    }
}
